<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class ProjectsAddTemplateStatus extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('projects', function(Blueprint $table) {
            $table->tinyInteger('template')->comment('是否是模板')->after('title');
            $table->tinyInteger('system')->comment('是否是系统内置')->after('template');
            $table->tinyInteger('status')->comment('状态')->after('system');

            $table->index('template');
            $table->index('system');
            $table->index('status');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('projects', function(Blueprint $table){
            $table->dropColumn(['template', 'system', 'status']);
        });
    }
}
